package com.xuecheng.media.service;

import com.xuecheng.commons.model.dto.MediaDto;
import com.xuecheng.commons.model.dto.MediaQueryDto;
import com.xuecheng.commons.model.dto.PageRequest;
import com.xuecheng.commons.model.dto.VodUploadDto;
import com.xuecheng.commons.model.vo.MediaVo;
import com.xuecheng.commons.model.vo.ResourceVo;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.commons.model.vo.VodUploadVo;
import com.xuecheng.media.domain.Media;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 媒资信息 服务类
 * </p>
 *
 * @author itheima
 * @since 2022-12-07
 */
public interface MediaService extends IService<Media> {
    // 获取上传凭证
    ResponseResult<VodUploadVo> vodToken(VodUploadDto dto);
    // 刷新上传凭证
    ResponseResult<VodUploadVo> refreshVodToken(String videoId);
    // 保存媒资
    ResponseResult saveMedia(MediaDto dto);
    // 媒资预览
    ResponseResult<String> preview(Long mediaId) throws Exception;
    // 媒资删除
    ResponseResult deleteMedia(Long mediaId) throws Exception;
    // 媒资分页查询
    ResponseResult<MediaVo> findByPage(PageRequest pageRequest, MediaQueryDto dto);
    // 课程详情页查询媒资播放地址
    ResponseResult<ResourceVo> mediaUrl(Long mediaId) throws Exception;
}
